package com.example.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@ResponseBody
@PropertySource(value = "application.properties",encoding = "utf-8")
public class TestController {

    @RequestMapping("/hi")
    public String saiHi() {
        return "Hello";
    }

    @Value("${spring.datasource.url}")
    private String mytest;

    @Value("${mytest}")
    private String mytest2;

    @RequestMapping("/getconfig")
    public String getConfig() {
        return  mytest2;
    }
}
